package com.hy.service.impl;

import com.hy.bean.PageResult;
import com.hy.dao.InstoretableDao;
import com.hy.dao.impl.InstoretableDaoImpl;
import com.hy.dto.InStoreSelectDto;
import com.hy.service.InstoretableService;
import com.hy.vo.InStoreVo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InstoretableServiceImpl implements InstoretableService {
    private final InstoretableDao instoretableDao = new InstoretableDaoImpl();

    @Override
    public PageResult getPages(Integer currPage, Integer pageSize, InStoreSelectDto inStoreSelectDto){
        List<InStoreVo> inStoreVos = instoretableDao.queryAllByLimit(currPage, pageSize, inStoreSelectDto);
        long count = instoretableDao.count(inStoreSelectDto);
        return new PageResult(inStoreVos, count, currPage, pageSize);
    }

}